package com.ysd.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ysd.entity.Askers;
import com.ysd.service.AskersService;
import com.ysd.util.Result;

@RestController
public class AskersController {
	@Autowired
	AskersService aS;
	@RequestMapping("getAsker")
	public Object getAsker(Askers a) {
		a.setPage((a.getPage()-1)*a.getLimit());
		List<Askers> list=aS.findAll(a);
		if (list!=null) {
			int n=aS.getCount(a);
			return Result.toClient("0", "查询成功", n, list);
					
		}
		return Result.toClient("1", "查询失败");
	}
	@RequestMapping("xgWeight")
	public Object xgWeight(Askers a) {
		int n=aS.xgAskerWeight(a);
		if (n>0) {
			return Result.toClient("0", "修改成功");
		}
		return Result.toClient("1", "修改失败");
	}
}
